package TabbedLesson
{
	import Assesment.AssesmentModel;
	
	import Glossary.GlossaryModel;
	
	import ScratchPad.ScratchPadModel;
	
	import Slides.SlideModel;
	
	import Video.VideoModel;
	
	public class LessonComponentFactory
	{
		private var lessonModel_object:Object=new Object;
		private var lessonView_object:Object = new Object;
		private var componentName_string:String;
		private var lessonPath:String;
		private var lessonEditMode_bool:Boolean;
		
		public function LessonComponentFactory(lessonModel:Object, lessonView:Object, path:String)
		{
			this.lessonModel_object = lessonModel;
			this.lessonView_object = lessonView;
			this.lessonPath=path;
			
			//this.componentName_string = componentName;
		}
		
		public function makeComponent(componentName:String):Object
		{
			var nullObj:Object=new Object;
			nullObj=null;
			
			switch(componentName)
			{
				case "Video":
					return this.addVideo();
					break;
				
				case "Glossary":
			         return this.addGlossary();
			         break;
			         
			    case "ScratchPad":
			          return this.addScratchPad();
			          break;
			    case "Slides":
			    	  return this.addSlides();
			    	  break;
			    	  
			    case "Assessment":
			    	  return this.addAssesment();
			    	  break;
			}
			
			return nullObj;
		}
		
		private function addVideo():Object
		{
			var videoModel:VideoModel = new VideoModel(this.lessonModel_object,this.lessonView_object,this.lessonPath, this.lessonModel_object.lessonEditMode_bool);
			return videoModel;
		}
		
		private function addScratchPad():Object
		{
			var scratchPadModel:ScratchPadModel = new ScratchPadModel(this.lessonModel_object,this.lessonView_object,this.lessonPath, this.lessonModel_object.lessonEditMode_bool);
			return scratchPadModel;	
		}
		
		private function addGlossary():Object
		{
			
			var glossaryModel:GlossaryModel = new GlossaryModel(this.lessonModel_object,this.lessonView_object,this.lessonPath, this.lessonEditMode_bool);
			return glossaryModel;
		}
		
		private function addSlides():Object
		{
			var slideModel:SlideModel=new SlideModel(this.lessonModel_object,this.lessonView_object,this.lessonPath, this.lessonEditMode_bool);
			return slideModel;
		}
		
		private function addAssesment():Object
		{
			var assesmentModel:AssesmentModel=new AssesmentModel(this.lessonModel_object,this.lessonView_object,this.lessonPath, this.lessonEditMode_bool);
			return assesmentModel;
		}
	}
}